package main

import (
	"fmt"
	"runtime"
	"time"
)

func hello() {
	time.Sleep(50*time.Second)//test
	fmt.Println("=============test==============")

	//for  i := 0; i < 100; i++ {
	//	fmt.Printf("Hello world goroutine %d\n",i)
		//if i == 40 {
		//	return
		//}
	//}
}

func main() {

	for i := 0; i < 1000000; i++ {
		fmt.Println("==========i==========:",i)
		go hello()
		fmt.Println("当前协程数:", runtime.NumGoroutine())
	}

	fmt.Println("main function")
}

